import { Component } from 'react'
import { Routes, Route, Navigate, NavLink } from 'react-router-dom'
import Home from '../views/home'
import Cate from '../views/cate'
import Cart from '../views/cart'
import Mine from '../views/mine'
import '../assets/css/index.css'
export default class Index extends Component {
    render() {
        return (
            <div>
                <Routes>
                    <Route path='home' element={<Home />}></Route>
                    <Route path='cate' element={<Cate />}></Route>
                    <Route path='cart' element={<Cart />}></Route>
                    <Route path='mine' element={<Mine />}></Route>
                    <Route path='*' element={<Navigate to='home'></Navigate>}></Route>
                </Routes>
    
                {/* 导航栏 */}
                <div className='bottom'>
                    <NavLink to='/index/home' className='li'>首页</NavLink>
                    <NavLink to='/index/cate' className='li'>分类</NavLink>
                    <NavLink to='/index/cart' className='li'>购物车</NavLink>
                    <NavLink to='/index/mine' className='li'>我的</NavLink>
                </div>
            </div>
        )
    }
}